<script>
import Common from "@/mixins/order/commonbg.js";
import OrderService from "@/api/order/OrderService.js";
import PPMForm from "@/crm3.0part7-ppm/core/ppmForm.vue";
export default {
  name: "mstp10461031",
  mixins: [PPMForm, Common],
  data() {
    return {
      //MSTP SDH	非正常变更	帐务变更
    };
  },
  async mounted() {
    await this.initCommon();
  },

  computed: {},
  methods: {
    getPluginValue(obj) {
      if (obj.key == "10461210-100013695") {
        let user = JSON.parse(sessionStorage.getItem("crm3-userinfo"));
        if (user.orgId != "1944640" && obj.data.orgId == "1944640") {
          this.$confirm("省客户不能选择集团公司为收款单位!", "提示", {
            confirmButtonText: "关闭",
            showCancelButton: false,
            type: "warning",
            center: true,
          });
        } else {
          this.formData["10461222-100011992"].text = obj.data.accountUnitName;
          this.formData["10461222-100011992"].value = obj.data.accountUnitCode;
          this.formData["10461223-100011992"].text = obj.data.accountUnitName;
          this.formData["10461223-100011992"].value = obj.data.accountUnitCode;
          this.formData["10461224-100012758"].text = obj.data.accountUnitName;
          this.formData["10461224-100012758"].value = obj.data.accountUnitCode;
          this.formData["10461225-100012795"].text = obj.data.accountUnitName;
          this.formData["10461225-100012795"].value = obj.data.accountUnitCode;
          this.formData["10461227-100010007"].text = obj.data.accountUnitName;
          this.formData["10461227-100010007"].value = obj.data.accountUnitCode;
          this.formData["10461228-100010007"].text = obj.data.accountUnitName;
          this.formData["10461228-100010007"].value = obj.data.accountUnitCode;
        }
      } else if (obj.key == "10461210-142003017") {
        this.formData["10461222-100012144"].text = obj.data.accountUnitName;
        this.formData["10461222-100012144"].value = obj.data.accountUnitCode;
        this.formData["10461223-100012144"].text = obj.data.accountUnitName;
        this.formData["10461223-100012144"].value = obj.data.accountUnitCode;
        this.formData["10461224-100012823"].text = obj.data.accountUnitName;
        this.formData["10461224-100012823"].value = obj.data.accountUnitCode;
        this.formData["10461225-100012836"].text = obj.data.accountUnitName;
        this.formData["10461225-100012836"].value = obj.data.accountUnitCode;
        this.formData["10461227-100010008"].text = obj.data.accountUnitName;
        this.formData["10461227-100010008"].value = obj.data.accountUnitCode;
        this.formData["10461228-100010008"].text = obj.data.accountUnitName;
        this.formData["10461228-100010008"].value = obj.data.accountUnitCode;
      }
    },
    getInputGridValue(obj) {
      if (obj.key == "10461222-100011992") {
        this.judgeID(obj.key, obj.data);
      } else if (obj.key == "10461223-100011992") {
        this.judgeID(obj.key, obj.data);
      } else if (obj.key == "10461224-100012758") {
        this.judgeID(obj.key, obj.data);
      } else if (obj.key == "10461225-100012795") {
        this.judgeID(obj.key, obj.data);
      } else if (obj.key == "10461227-100010007") {
        this.judgeID(obj.key, obj.data);
      } else if (obj.key == "10461228-100010007") {
        this.judgeID(obj.key, obj.data);
      }
    },
    judgeID(key, value) {
      let user = JSON.parse(sessionStorage.getItem("crm3-userinfo"));
      if (user.orgId != "1944640" && value.orgId == "1944640") {
        this.formData[key].text = "";
        this.formData[key].value = "";
        this.$confirm("省客户不能选择集团公司为收款单位!", "提示", {
          confirmButtonText: "关闭",
          showCancelButton: false,
          type: "warning",
          center: true,
        });
      } else {
        this.formData[key].text = value.accountUnitName;
        this.formData[key].value = value.accountUnitCode;
      }
    },
  },
};
</script>